# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-validators
pkgname=('python2-validators' 'python-validators')
_pkgname=validators
pkgver=0.35.0
pkgrel=1
pkgdesc='Python Data Validation for Humans.'
arch=('any')
url='https://pypi.org/project/validators/#files'
license=('BSD')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('abc447981df4747c6c167b8d79170ec4081d4c9b30b81d0ab3b2652e9eb94e5770b012149c3a49a328ec531785ce57d34a76de06e58ac0e0ad88b55d51e9590c')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-validators() {
  depends=('python2' 'python2-six' 'python2-decorator')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

package_python-validators() {
  depends=('python' 'python-six' 'python-decorator')

  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

